package com.gusto.engine.semsim.measures.impl;

import org.apache.log4j.Logger;

import com.gusto.engine.beans.model.Res;
import com.gusto.engine.semsim.exceptions.SimilarityException;
import com.gusto.engine.semsim.measures.ResourceSimilarity;
import com.gusto.engine.semsim.measures.ValueSimilarity;

/**
 * <p>Returns a random value as the similarity.
 * Use only for prototyping.</p>
 * 
 * @author amokrane.belloui@gmail.com
 */
public class RandomValueSimilarity implements ValueSimilarity, ResourceSimilarity {
	
	private Logger log = Logger.getLogger(getClass());
	
	public String getId() {
		String id = "[" + getClass().getName() + "]";
		return id;
	}
	
	public Double getSimilarity(Object value1, Object value2) throws SimilarityException {
		Double sim = Math.random();
		log.info("Random value " + sim);
		return sim;
	}
	
	public Double getSimilarity(Res value1, Res value2) throws SimilarityException {
		Double sim = Math.random();
		log.info("Random value " + sim);
		return sim;
	}
	
}
